package com.ibm.cps.spark.streaming.adapter;

import backtype.storm.task.IOutputCollector;
import backtype.storm.tuple.Values;

import com.ibm.cps.message.AbstractMessage;
import com.ibm.cps.message.RawDataMessage;
import com.ibm.util.exception.CPSException;

/**
 * Created by telekinesis on 4/27/15.
 */
public class SparkEmbeddedSpout extends AbstractSparkEmbeddedSpout {

	public SparkEmbeddedSpout(IOutputCollector collector) {
		super(collector);
	}

	public void emitNewData(String streamName, final byte[] data) throws CPSException {
		// parseData
		/* TODO */
		RawDataMessage parsedData = new RawDataMessage(null, null, null, -1, data);
		collector.emit(streamName, null, new Values("Value1", parsedData));
	}

	@Override
	public void emitNewData(String streamName, AbstractMessage data) {
		// TODO Auto-generated method stub

	}

}
